home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 428_02 / libsrc / pause.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-13  |  493 b   |  27 lines

  1. /*
  2. ** pause.c
  3. **
  4. ** Pictor, Version 1.51, Copyright (c) 1992-94 SoftCircuits
  5. ** Redistributed by permission.
  6. */
  7.  
  8. #include <bios.h>
  9. #include "pictor.h"
  10.  
  11. /*
  12. ** Suspends program execution for the specified duration.
  13. */
  14. void pause(int duration)
  15. {
  16.     long curtime,endtime;
  17.  
  18.     _bios_timeofday(_TIME_GETCLOCK,&curtime);
  19.     endtime = (curtime + (long)duration);
  20.  
  21.     while(curtime < endtime) {
  22.         if(_bios_timeofday(_TIME_GETCLOCK,&curtime))
  23.             endtime -= 1573040L;
  24.     }
  25.  
  26. } /* pause */
  27.